# -- coding: utf-8 --
# @Time : 2021/3/17--20:01
# @Author : ChinaV
# @File : 基本操作题 3：完数.py

for i in range(2, 1001):
    l = []
    for j in range(1, i):
        if i % j == 0:
            l.append(j)
    if sum(l) == i:
        print(i)

for i in range(2, 1001):
    s = i
    for j in range(1, i):
        if i % j == 0:
            s -= j
    if s == 0:
        print(i)
